package com.ccovo.enums;

/**
 * 自定义错误码
 *
 */
public enum ErrorCode {

    SUCCESS(200, "成功"),
    PARAMS_ERROR(40000, "请求参数错误"),


    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    NO_ROLE_AUTH_ERROR(40102, "无角色权限"),
    NO_PERMISSION_AUTH_ERROR(40103, "无方法权限"),
    NO_SAFE_AUTH_ERROR(40104, "二级认证失败"),
    NO_HTTP_BASIC_ERROR(40105, "Http Basic校验失败"),
    NO_HTTP_DIGEST_ERROR(40106, "Http Basic校验失败"),


    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    TOKEN_INVALID_ERROR(401, "无效的token"),
    TOKEN_CHECK_ERROR(401, "token验证失败，请重新登录"),
    PARAM_LOST_ERROR(4001, "参数缺失"),
    USER_EXIST_ERROR(5001, "用户名已存在"),
    USER_NOT_LOGIN(5002, "用户未登录"),
    USER_ACCOUNT_ERROR(5003, "账号或密码错误"),
    USER_NOT_EXIST_ERROR(5004, "用户不存在"),
    CODE_CAPTCHA_ERROR(5005, "图形验证码错误"),
    MAIL_CODE_CAPTCHA_ERROR(5006, "邮箱验证码错误"),
    CODE_SEND_SUCCESS(5007,"验证码发送成功"),
    CODE_LIMITED(5007,"验证码发送过快"),
    CODE_TO_ERROR(5007,"接收号码不合规"),
    MAIL_EXIST(5008, "邮箱账号已使用"),
    FILE_UPLOAD_SUCCESS(6001,"文件上传成功"),
    FILE_UPLOAD_FAIL(6001,"文件上传失败"),
    PARAM_PASSWORD_ERROR(5005, "原密码输入错误");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
